package com.jbp.controller;

import com.jbp.model.WalletRecord;
import com.jbp.service.WalletRecordService;
import com.jbp.utils.PageUtils;
import com.jbp.utils.R;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import java.util.Map;

/**
 * 钱包变动记录(WalletRecord)表控制层
 * @author cc
 * @since 2020-06-20 09:43:00
 */
@Api(tags ="APP接口-个人-钱包记录" )
@ApiIgnore
@RestController
@RequestMapping("rest/walletRecord")
public class WalletRecordController {
    @Autowired
    private WalletRecordService walletRecordService;

    /** 列表 */
    @ApiOperation(value="钱包变动记录")
    @ApiResponses({
            @ApiResponse(code = 200,message = "成功",response = WalletRecord.class),
            @ApiResponse(code = 201,message = "返回失败信息")
    })
    @ApiImplicitParams({
            @ApiImplicitParam(name = "coinType",value = "类型  xinzuan 心钻, aixin 爱心",paramType = "query"),
            @ApiImplicitParam(name="time",value = "时间  2020-08",paramType = "query"),
    })
    @GetMapping("/list")
    public R list(@RequestAttribute("userId") Integer userId, @RequestParam Map<String, Object> params){
        PageUtils page = walletRecordService.queryPage(userId, params);
        return R.ok().put("data", page);
    }
}